<!--  -->
<template>
    <div class="base-container"><el-button @click="export2">导出测试</el-button></div>
</template>

<script>
let component;
import { onMounted, inject } from 'vue';//调用插件中的共用函数需要引入vue的inject
export default {
    setup() {
        //依赖注入插件中对应的共用函数
        const exportExcel = inject('exportExcel');
        const asyncPost = inject('asyncPost');

        const export2 = async () => {
            let fileName = '2345';//前端定义文件名
            //调用 exportExcel函数 传入后端处理excel的文件名参数和相关其他计算参数
            await exportExcel({ actionType: 'testExcel', title: fileName, fileName: fileName + '.xlsx' });
        };
        onMounted(async () => {
            let dd = await asyncPost('sysMenu', { actionType: "sysMenuQuery", sysMenuType: 1 });//直接调用inject注入的函数即可
            console.log(dd);
        });
        return { export2 };
    }
    /*  data() {
         return {
         };
     },
 
     components: {},
 
 
     methods: {
         async export2() {//通用导出模块
             let fileName = '2345';//前端定义文件名
 
             //调用 exportExcel函数 传入后端处理excel的文件名参数和相关其他计算参数
             await this.$exportExcel({ actionType: 'testExcel', dateRange: this.dateRange, title: fileName, fileName: fileName + '.xlsx' });
         }
     },
     mounted() {
         component = this;
     } */
}

</script>
<style lang='scss' scoped>
.page-test-view-container {
    margin-top: 30px;
}
</style>